package com.rrqs.activity;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.TextView;

import com.rrqs.activity.common.Const;
import com.zadtek.xmqishi.R;

/**
 * 通知中心
 * @author Administrator
 *
 */
public class TongzhiCenterActivity extends Activity {
	private ImageView backid;
	private TextView topview;
	private WebView webview;
	String titleurl="";
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.managementrules);
		SharedPreferences sp = getSharedPreferences(Const.PREF_NAME, Context.MODE_PRIVATE);
		String uid = sp.getString("uid", "");
		titleurl="https://rider.zadtek.com/Hpage/notice?emp_id=" + uid;
		
		backid = (ImageView) findViewById(R.id.backid);
		topview = (TextView) findViewById(R.id.topview);
		topview.setText("通知中心");

		webview =(WebView) findViewById(R.id.management);

		backid.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				TongzhiCenterActivity.this.finish();
			}
		});
		webview.loadUrl(titleurl);
		// 覆盖WebView默认使用第三方或系统默认浏览器打开网页的行为，使网页用WebView打开
		webview.setWebViewClient(new WebViewClient() {
			@Override
			public boolean shouldOverrideUrlLoading(WebView view, String url) {
				// TODO Auto-generated method stub
				// 返回值是true的时候控制去WebView打开，为false调用系统浏览器或第三方浏览器
				view.loadUrl(url);
				return true;
			}
		});
	}
}
